package com.szrt.oa.role.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.szrt.oa.base.service.impl.BaseServiceImpl;
import com.szrt.oa.role.dao.RoleDao;
import com.szrt.oa.role.entity.RoleEntity;
import com.szrt.oa.role.service.RoleService;


@Service
public class RoleServiceImpl extends BaseServiceImpl<RoleEntity> implements RoleService  {

	@Autowired
	private  RoleDao roleDao;
	/**
	 * 模糊查询
	 */
	@Override
	public Map<String, Object> selectByname(RoleEntity entity) {
		
		Map<String, Object> map=new HashMap<String, Object>();
		List<RoleEntity> jg=null;
		try {
			jg = roleDao.selectByname(entity);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		map.put("jg", jg);
		
		
		return map;
	}
	
	/**
	 * 模糊查询
	 */
	@Override
	public Map<String, Object> selectBynameByregexp(RoleEntity entity) {
		
		Map<String, Object> map=new HashMap<String, Object>();
		List<RoleEntity> jg=null;
		try {
			jg = roleDao.selectBynameregexp(entity);
			map.put("jg", jg);
			map.put("code", 200);
		} catch (Exception e) {
			map.put("code", 999);
			
			e.printStackTrace();
		}
		
		
		
		
		return map;
	}
	

}
